package com.tao.springbootstudy01hello;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/** @ SpringBootApplication中的scanBasePackages配置项可以改变扫描包路径
 * */
/**<p>@SpringBootApplication可以用
 *@ SpringBootConfiguration
 *@ EnableAutoConfiguration
 *@ ComponentScan==扫描包路径
 *三个组件代替*/
@SpringBootApplication
public class SpringBootStudy01HelloApplication {

    public static void main(String[] args) {

        /**返回所有IOC容器组件*/
        ConfigurableApplicationContext run = SpringApplication.run(SpringBootStudy01HelloApplication.class, args);
        /** 获取容器中所有bean组件的名字*/
        String[] name = run.getBeanDefinitionNames();
        for (String s : name) {
            System.out.println(s);
        }
    }

}
